const http=(obj)=>{
	return new Promise((resolve,reject)=>{
		wx.request({
            url: 'https://route.showapi.com'+obj.url,
            method:obj.method || 'GET',
            data:obj.data || {},
            header:obj.header || {'Content-type':'application/json'},
            success:(res)=>{
			   resolve(res)
			   if (res.data.code == 200) {
				// 修改navigationBarTitleText
				wx.setNavigationBarTitle({
					title: title
				})
			}
			},
			fail:(err)=>{
				reject(err);
			}
        })
	});
}
export default http;